<?php declare(strict_types=1);


namespace App\Model\Entity;

use Swoft\Db\Annotation\Mapping\Column;
use Swoft\Db\Annotation\Mapping\Entity;
use Swoft\Db\Annotation\Mapping\Id;
use Swoft\Db\Eloquent\Model;


/**
 * 
 * Class Msg
 *
 * @since 2.0
 *
 * @Entity(table="msg")
 */
class Msg extends Model
{
    /**
     * 
     * @Id()
     * @Column(name="msg_id", prop="msgId")
     *
     * @var int
     */
    private $msgId;

    /**
     * to user_id or team_id
     *
     * @Column()
     *
     * @var int
     */
    private $rid;

    /**
     * 0: normal msg
1: image msg
2: normal link msg
3: goods link msg
     *
     * @Column(name="msg_type", prop="msgType")
     *
     * @var int|null
     */
    private $msgType;

    /**
     * 
     *
     * @Column()
     *
     * @var string
     */
    private $content;

    /**
     * 
     *
     * @Column(name="created_at", prop="createdAt")
     *
     * @var int
     */
    private $createdAt;


    /**
     * @param int $msgId
     *
     * @return void
     */
    public function setMsgId(int $msgId): void
    {
        $this->msgId = $msgId;
    }

    /**
     * @param int $rid
     *
     * @return void
     */
    public function setRid(int $rid): void
    {
        $this->rid = $rid;
    }

    /**
     * @param int|null $msgType
     *
     * @return void
     */
    public function setMsgType(?int $msgType): void
    {
        $this->msgType = $msgType;
    }

    /**
     * @param string $content
     *
     * @return void
     */
    public function setContent(string $content): void
    {
        $this->content = $content;
    }

    /**
     * @param int $createdAt
     *
     * @return void
     */
    public function setCreatedAt(int $createdAt): void
    {
        $this->createdAt = $createdAt;
    }

    /**
     * @return int
     */
    public function getMsgId(): ?int
    {
        return $this->msgId;
    }

    /**
     * @return int
     */
    public function getRid(): ?int
    {
        return $this->rid;
    }

    /**
     * @return int|null
     */
    public function getMsgType(): ?int
    {
        return $this->msgType;
    }

    /**
     * @return string
     */
    public function getContent(): ?string
    {
        return $this->content;
    }

    /**
     * @return int
     */
    public function getCreatedAt(): ?int
    {
        return $this->createdAt;
    }

}
